package ru.dc.object;

import ru.dc.object.commands.Search;

/**
 * <pre>
 * User: Penkov Vladimir
 * Date: 02.11.2010
 * Time: 17:52:40
 * </pre>
 */
public interface SearchConstants {

    public static enum SearchType {
        ANY(1, "search.type.any"),
        AUDIO(2, "search.type.audio"),
        ARCHIVE(3, "search.type.archive"),
        DOCUMENTS(4, "search.type.documents"),
        EXECUTABLES(5, "search.type.executables"),
        PICTURES(6, "search.type.pictures"),
        VIDEO(7, "search.type.video"),
        FOLDERS(8, "search.type.folders"),
        TTH(9, "search.type.tth");

        private int id;
        private String description;

        SearchType(int id, String description) {
            this.id = id;
            this.description = description;
        }

        public String getDescription() {
            return description;
        }

        public int getId() {
            return id;
        }

        @Override
        public String toString() {
            return getDescription();
        }
    }


    public static enum SearchSizeType {

        IGNORE("search.sizetype.ignore", null),
        NOT_LESS("search.sizetype.not_less_then", false),
        LESS("search.sizetype.less_then", true);

        private Boolean maxSize;
        private String description;

        SearchSizeType(String description, Boolean maxSize) {
            this.description = description;
            this.maxSize = maxSize;
        }

        public String getDescription() {
            return description;
        }

        public Boolean isMaxSize() {
            return maxSize;
        }

        @Override
        public String toString() {
            return getDescription();
        }
    }

    public static enum SearchSizeMultiplier {

        BYTES("B", 1),
        KB("KB", 1024),
        MB("MB", 1024*1024),
        GB("MB", 1024L*1024*1024);

        private long multiplier;
        private String description;

        SearchSizeMultiplier(String description, long multiplier) {
            this.description = description;
            this.multiplier = multiplier;
        }

        public String getDescription() {
            return description;
        }

        public long getMultiplier() {
            return multiplier;
        }
    }

}
